package com.maker.ai.mapper;


import com.maker.ai.entity.Reservation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReservationMapper {
    //添加预约信息的方法
    @Insert("insert into reservation(name,gender,phone,communication_time,province,estimated_score) values(#{name},#{gender},#{phone},#{communicationTime},#{province},#{estimatedScore})")
    void insert(Reservation reservation);
    //根据手机号，查询预约信息的方法
    @Select("select * from reservation where phone=#{phone}")
    Reservation findByPhone(String phone);
    @Select("select * from reservation")
    List<Reservation> getAllReservations();
    @Select("select * from reservation where name like concat('%',#{name},'%')")
    List<Reservation> findByName(String name);
}
